/**   
 * @Title: ErrorAction.java 
 * CopyRight(c)2010-DMX 
 */
package com.dmx.fw.web.struts2.action;

import java.util.Map;

import com.dmx.fw.constant.ViewConstant;
import com.opensymphony.xwork2.ActionContext;

/** 
 * @Description: ErrorAction
 * @author: system
 * @date: 2006
 * @version V1.0 
 * 
 */
public class ErrorAction extends BaseAction{
	public String execute() throws Exception{
		ActionContext ctx = ActionContext.getContext();			
		String[] errorInfos = (String[])(ctx.getParameters().get("errorInfo"));
		if (errorInfos!=null && errorInfos.length>0){
			for(int i = 0;i<errorInfos.length; i++){
				super.setErrorInfo(errorInfos[i]);
			}
		}
		
		String[] errorDetail = (String[])(ctx.getParameters().get("error_detail"));
		
		if (errorDetail!=null && errorDetail.length>0 && ctx.getSession()!=null){
			ctx.getSession().put(ViewConstant.GLOBAL_DETAIL_ERROR_INFO_KEY,errorDetail[0]);
		}
		return super.execute();
		
	}

}
